spring:
  application:
    name: ${projectName}
  profiles:
    #环境切换 dev, pro
    active: dev
  jackson:
    time-zone: GMT+8
    date-format: yyyy-MM-dd HH:mm:ss
  datasource:
    druid:
      driver-class-name: com.mysql.cj.jdbc.Driver
      initial-size: 10
      max-active: 100
      min-idle: 10
      max-wait: 60000
      pool-prepared-statements: true
      max-pool-prepared-statement-per-connection-size: 20
      time-between-eviction-runs-millis: 60000
      min-evictable-idle-time-millis: 300000
      validation-query: select 1
      test-while-idle: true
      test-on-borrow: false
      test-on-return: false
      filter:
        stat:
          log-slow-sql: true
          slow-sql-millis: 1000
          merge-sql: false
        wall:
          config:
            multi-statement-allow: true
  mvc:
    pathmatch:
      matching-strategy: ant_path_matcher

mybatis-plus:
  mapper-locations:
    - "classpath*:/mybatis/**/*.xml"
    - "classpath*:/mapper/**/*.xml"
  global-config:
    db-config:
      id-type: auto
    banner: off
  configuration:
    map-underscore-to-camel-case: true


#  测试环境
---
server:
  port: ${port}
  servlet:
    context-path:
spring:
  # swagger开关(测试环境中打开)
  swagger-switch:
    enable: true
  config:
    activate:
      on-profile: dev
  datasource:
    druid:
      url: ${url}?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowPublicKeyRetrieval=true
      username: ${userName}
      password: ${password}
      stat-view-servlet:
        enabled: true
        url-pattern: /druid/*
        #如果开启了druid连接池后台, 为了数据安全, 必须设置复杂的账号和密码
        login-username: admin
        login-password: admin
mybatis-plus:
  configuration:
    log-impl: org.apache.ibatis.logging.stdout.StdOutImpl


# 生产环境
---
server:
  port: ${port}
  servlet:
    context-path:
spring:
  # swagger开关(生产环境关闭)
  swagger-switch:
    enable: false
  config:
    activate:
      on-profile: pro
  datasource:
    druid:
      url: ${url}?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowPublicKeyRetrieval=true
      username: ${userName}
      password: ${password}
#      stat-view-servlet:
#        enabled: true
#        url-pattern: /druid/*
##        如果开启了druid连接池后台, 为了数据安全, 必须设置复杂的账号和密码
#        login-username: admin
#        login-password: admin
mybatis-plus:
  configuration:
    log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
